//
//  DishControl.h
//  XRmenu
//
//  Created by gaomz on 11-3-29.
//  Copyright 2011 E0571. All rights reserved.
//

#import "XRmenuBaseView.h"
#import "Product.h"

@protocol dishControlDelegate;
@interface DishControl : XRmenuBaseView<AVAudioPlayerDelegate> {
	BOOL isPlaySound;
	AVAudioPlayer *audioPlayer;
	
	UIImage *normalImage;
	UIImage *selectedImage;
//	UIImage *hightlightedImage;
//	UIImage *disabledImage;
	
	
	CGRect audioFrame;
	CGRect videoFrame;
	CGRect relateFrame;
	CGRect relateNumFrame;
	CGRect commendFrame;
	CGRect dishNameFrame;
	CGRect dishPriceFrame;
	CGRect lineFrame;
	CGRect linePointFrame;
	
	UIButton *btnAudio;
	UIButton *btnVideo;
	UIButton *btnRelate;
	UILabel  *lblRelateNum;
	UIImageView *imgCommend;
	UILabel  *lblDishName;
	UILabel  *lbldishPrice;
	UIImageView *imgLine;
	UIImageView *imgLinePoint;
	UIButton *btnDishNum;
	UIButton *btnDetail;
	
	
	Product *product;
	NSInteger productIndex;
	NSInteger productCount;
	
	id<dishControlDelegate> deleagate;
}

@property (nonatomic, retain) Product *product;
@property (nonatomic, assign) NSInteger productIndex;
@property (nonatomic, assign) NSInteger productCount;
@property (nonatomic, assign) id<dishControlDelegate> deleagate;
@property (nonatomic, retain) AVAudioPlayer *audioPlayer;

-(id)initWithViewName:(NSString *)vname;
-(void)refreshControlStatus:(Product *)cProduct cProductIndex:(NSInteger)cProductIndex cProductCount:(NSInteger)cProductCount;

-(void)PlaySound;
-(void)StopSound;
//-(void)audioPlayerStoped:(NSNotification*)notification;
-(void)changeAudioState;
-(void) playSoundOnEvent:(NSString *)mp3File;

@end

@protocol dishControlDelegate

-(void)DisplayVideo;
-(void)DisplayDetail;
-(BOOL)AddDish;
-(void)switchToAlbum;
-(void)refreshRelateStatus;
@end
